package collection;

import java.util.ArrayList;
import java.util.Collections;
//import java.util.Collection;
//import java.util.Iterator;

public class TestCollection {
	public static void main(String[] args) {
		//Creating user define class object
		Student s1 = new Student(05, "vibhanshu", 24);
		Student s2 = new Student(03, "sitanashu", 23);
		Student s3 = new Student(04, "rajeev", 25);
		Student s4 = new Student(01, "sitanshu", 23);
		ArrayList<Student> al = new ArrayList<Student>();
		al.add(s1);
		al.add(s2);
		al.add(s3);
		al.add(s4);
		
		/*al1.add("vibhanshu");
		al1.add("sitanshu");
		*/
		/**Student s5 = new Student(06, "praveen", 25);
		Student s6 = new Student(02, "Vikas", 32);
		ArrayList<Student> al1 = new ArrayList<Student>();
		al1.add(s5);
		al1.add(s6);
		al.addAll(al1);*/
		Collections.sort(al);
		/*Iterator<Student> it = al.iterator(); //traversing the element of arraylist
		while (it.hasNext()){
			Student st = (Student)it.next();
		*/	
		for(Student str : al)
			System.out.println(str);
		//System.out.println(st.rollno+" "+st.name+" "+st.age);
		}
	}

